<%@ page language="java" import="com.alibaba.fastjson.JSONObject" pageEncoding="UTF-8" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%--试卷审批流程结束后更新考题设置主表字段和明细表字段是否被引用--%>
<%
    RecordSet rs = new RecordSet();
    String requestid = Util.null2String(request.getParameter("requestid"));
    JSONObject jsonData = new JSONObject();
    String formtable = "formtable_main_295";
    String[] list = new String[]{"1", "2", "3", "4"};
    for (String dtl:list) {
        String dtltable = formtable+"_dt"+dtl;
        
        rs.executeQuery("select t1.tm from " + formtable + " t join " + dtltable + " t1 " +
                "on t.id=t1.mainid where t.requestid=?", requestid);
        while (rs.next()) {
            String tm = Util.null2String(rs.getString("tm"));
            rs.executeUpdate("update uf_ktsz set sfbyy=0 where id=?", tm);
            rs.executeUpdate("update uf_ktsz_dt1 set sfbyy=0 where mainid=?", tm);
        }
    }
    jsonData.put("flag", true);
    out.print(jsonData.toJSONString());

%>
